import type { GoodsItemType } from '@/types/goods'
import request from '@/utils/request'

// 获取商品列表
export const getGoodsListAPI = () => request.get('/product/list')
export const getGoodsListAPI2 = (): Promise<GoodsItemType[]> => request.get('/api/product')

// 商品详情
export const getGoodsItemAPI = (productId: any): Promise<GoodsItemType> => request.get(`/api/product/${productId}`)

// 获取商品评论
export const getGoodsCommentListAPI = (productId: any) => request.get(`/api/comment/${productId}`)

// 发表商品评论
export const postGoodsCommentAPI = (data: any) => request.post(`/api/comment`, data)
